/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.ucue.sep.gestores;

import java.io.Serializable;
import javax.el.ELContext;
import javax.el.ValueExpression;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;

/**
 *
 * @author CHRISTIAN
 */
@ManagedBean(name="generalManager")
@SessionScoped
public class GeneralManager implements Serializable{
    
    public static GeneralManager getInstance() {
        ELContext context = FacesContext.getCurrentInstance().getELContext();
        ValueExpression ex = FacesContext.getCurrentInstance().getApplication().getExpressionFactory().
                createValueExpression(context, "#{generalManager}", GeneralManager.class);
        return (GeneralManager) ex.getValue(context);
    }
    
    public String navegarClientes(){
        ClienteManager.getInstance().init();
        return "cliente";
    }
    
    public String navegarSucursales(){
        SucursalManager.getInstance().init();
        return "sucursal";
    }
    
    public String navegarNuevoPaquete(){
        PaqueteManager.getInstance().init();
        return "nuevoPaquete";
    }
    
    public String returntoIndex(){
        return "index";
    }
}
